<?php

// 广告位表

namespace app\console\model;
use think\Db;
use think\Model;
use think\Request;
use app\common\trilateral\Classify as ClassifyAlias;
use think\Session;
use think\Hook;

class Draw extends Model
{
    // 模型事件
    protected static function init()
    {

        self::event('before_write', function ($data) {
           // $data->pic_url = uploadImg('pic_url');
            auding($data);

        });
    }

    protected function base($query)
    {
        $query->where('is_delete',1);
    }

    public function getAudingTextAttr($value, $data)
    {
        $status = [1 => '等待审核', 2 => '审核成功', 3 => '审核失败'];
        return $status[$data['auding_status']];
    }
//
    public function getAudingManageAttr($value, $data)
    {
       $ret = Db::name('manager')->where('id',$data['auding_id'])->value('username');
        return $ret;
    }
    public function getCreateManageAttr($value, $data)
    {
        $ret = Db::name('manager')->where('id',$data['create_id'])->value('username');
        return $ret;
    }
//    public function getNewsTypeAttr($value, $data)
//    {
//        $ret = Db::name('news_type')->where('id',$data['type_id'])->value('type_name');
//        return $ret;
//    }

}